<!-- jQuery -->
<script src="/static/adminlte/plugins/jquery/jquery.min.js"></script>
<!-- jQuery UI 1.11.4 -->
<script src="/static/adminlte/plugins/jquery-ui/jquery-ui.min.js"></script>
<!-- Bootstrap 4 -->
<script src="/static/adminlte/plugins/bootstrap/js/bootstrap.bundle.min.js"></script>
<!-- overlayScrollbars -->
<script src="/static/adminlte/plugins/overlayScrollbars/js/jquery.overlayScrollbars.min.js"></script>
<!-- AdminLTE App -->
<script src="/static/adminlte/js/adminlte.min.js"></script>
<!--引入layer.js-->
<script src="/static/adminlte/plugins/layer/layer.js"></script>
<!--引入自定义的js函数-->
<script src="/static/adminlte/plugins/bs/common.js"></script>
<!--jquery.form-->
<script src="/static/adminlte/plugins/bs/jquery.form.js"></script>
<!--和php同样的函数-->
<script src="/static/adminlte/plugins/bs/php.js"></script>
<script>

    //选中菜单的颜色
    $(document).ready(function() {

        /** add active class and stay opened when selected */
        var url = window.location;
        // for sidebar menu entirely but not cover treeview
        $('ul.nav-sidebar a').filter(function() {
            return this.href == url;
        }).addClass('active');
        // for treeview
        $('ul.nav-treeview a').filter(function() {
            return this.href == url;
        }).parentsUntil(".nav-sidebar > .nav-treeview").addClass('menu-open').prev('a').addClass('active');


    })
    $(function () {
        if ($(".merchant-msg-count-box").length>0){
            setInterval(function () {
                check_msg();
            },30000)
        }
        check_msg();
    })
    function check_msg() {
        sendData("<{:url('/plugin/merchant.msg/msg_count')}>",{},function (res) {
            if (res.code==0){
                var $box = $(".merchant-msg-count-box")[0];
                $($box).find('.total-count').text(res.data.total>0?res.data.total:'')
            }
        },true,true)
    }
</script>